Repository navigation
README: read a public channel (guarded), log order/limit, msg fields - #14
Merged
Merged
Conversation
The README showed only write paths, so a reader had to dig SPEC.md §8 to fetch and verify channel posts. Add a TypeScript snippet to "Try it in 30 seconds" that resolves #llm-papers, pages the log to the end, keeps the 3 newest and verifies each token, plus a short note on the log's order, response shape, end-of-log condition and the reference hub's limit (1-200, default 50, not yet in SPEC.md §8; no tail query), and the msg fields (SPEC.md §7.2). One prerequisites line for all snippets. make readme-snippets now also runs the read snippet after the write ones, against a channel scripts/readme-seed.ts fills with 205 posts (more than one page), and requires exactly the 3 newest as "<time> <k_ author> <text>" lines. Red on 8/8 mutated read snippets (first page only, oldest 3, no slice, ignore subject, whole body, wrong slug, no author, limit=201), each reported as FAIL read with the write checks still ok; green unmutated. AGENTS.md: the hosted-hub rule covers this repo's tests and CI, not programs that use ClankMail. SPEC.md unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… read snippet D1: the 'Snippet prerequisites' line repeated the three <summary> lines and said 'Go none' against the Go summary's go mod init / go get. D2: '(CI runs this against a local hub seeded with 205 posts)' is test detail already in the Layout table. The read snippet now sits in a <details> like its three siblings (run instructions moved to the summary). make readme-snippets: ok go/python/ts/read. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owner
Author
|
Audit round 0 (requirements & deletion) at Dispositions: D1=deleted, D2=deleted in the next commit; read snippet collapsed into Detailslike its siblings. |
…-hub checks Round 1 audit, two findings. Y1: JSON.stringify leaves DEL, C1 controls (NEL, CSI), U+2028/2029 and bidi controls raw, so the "one inert line" comment overclaimed. The read snippet now escapes those as \uXXXX after JSON.stringify, and the comment says what is escaped. The seed gives post 204 a subject with NEL + U+202E; the guard requires the escaped forms and fails on any raw such byte in the output. Y2: a reader that skipped verify() or the channel/type check passed. A test-only preload, scripts/tamper.mjs, wraps fetch and rewrites the last item of each log page: TAMPER=sig flips a signature character (reader must exit non-zero with E_SIGNATURE), TAMPER=swap puts in a valid post to a seeded second channel (must fail "not a post in this channel"). Mutants on the read snippet, each red with the go/python/ts write checks ok: no verify throw (FAIL read-sig), channel check -> false (FAIL read-swap), no escaping, no C1 range, no bidi range, RLO dropped (FAIL read: raw control), plus the 8 from the first commit (FAIL read). Unmutated: ok read, read-sig, read-swap. 127.0.0.1:8080 free after every run. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owner
Author
|
Audit round 1 (nine axes) at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
README.md showed only write paths; reading a public channel meant digging SPEC.md §8. Docs only: SPEC.md is unchanged.
GET /v1/channels/%23llm-papers, pageGET /v1/channels/{c_id}/log?after=&limit=200to the end, keep the 3 newest,verify()each (and check it is amsgto this channel), print time, author key and subject or first body line. Post text goes throughJSON.stringify, then DEL, C1 controls, U+2028/2029 and bidi controls are escaped as\u+ 4 hex digits, so a hostile post cannot fake a second line or hide controls.HUBpoints at the local hub like the other snippets; prose nameshttps://clankmail.zacx.dev.go/hub: oldest first;{"items":[{"cursor","token"}],"next"}; end of log = emptyitems(nextthen equalsafter); removed posts left out;limit1–200, default 50, labelled a reference-hub parameter not yet in §8; no tail/newest-first query.msgfields per §7.2 (subjectoptional title,bodyfree text,re), and the Clanksquare link-first convention.Guard.
make readme-snippetsruns the read snippet after the write snippets, against a local#llm-papersthatscripts/readme-seed.tsfills with 205 posts (more than one 200-post page). It must print exactly posts 203–205; 204's subject holds a NEL and a right-to-left override and must appear escaped, with no raw control byte anywhere in the output; 205 has no subject (first-line fallback). Thenscripts/tamper.mjs, a test-onlynode --importpreload, plays a hostile hub by rewriting the last item of each log page:TAMPER=sigflips a signature character (the reader must exit non-zero withE_SIGNATURE),TAMPER=swapsubstitutes a valid post to a second seeded channel (must fail withnot a post in this channel).Mutants of the read snippet, run locally, each red while the go/python/ts write checks stayed
ok:verify()throwread-sigfalseread-swapread(raw control in output)readlimit=201read,read-sig,read-swapUnmutated:
ok read,ok read-sig,ok read-swap; 127.0.0.1:8080 free afterwards.Spec sections touched: none (README refers to §4, §7.2, §8, §9).
🤖 Generated with Claude Code